{% extends 'starter.html' %}

{% block title %}
  <h1>
    客户信息展示
  </h1>
{% endblock %}

{% block content %}
  <a href="{% url 'add_customer' %}" class="btn btn-primary">
    添加客户
  </a>
  <form class="form-inline">
    <div class="form-group">
      <select name="action" id="action" class="form-control">
        <option value="">公户转私户</option>
        <option value="">私户转公户</option>
      </select>
      <button class="btn btn-warning">go</button>
    </div>


    <div class="form-group pull-right">
      <select name="search_field" id="search_field" class="form-control">
        <option value="qq__contains">qq</option>
        <option value="name__contains">name</option>
        <!--  search_field:name  kw:1111  filter(name=1111) -->

      </select>
      <input type="text" class="form-control" id="key_word" placeholder="请输入搜索内容" name="kw">
      <button type="submit" class="btn btn-default">搜索</button>
    </div>

  </form>
  <table class="table table-striped table-hover table-bordered"
  >
  <thead>
  <tr>
    <th><input type="checkbox" id="select_all">选择</th>
    <th>序号</th>
    <th>id</th>
    <th>qq</th>
    <th>姓名</th>
    <th>性别</th>
    <th>报名状态</th>
    <th>转介绍自学员</th>
    <th>销售</th>
    <th>操作</th>

  </tr>
  </thead>
  <tbody>
  {% for customer_obj in customer_objs %}
    <tr>
      <td>
        <input type="checkbox" name="cids">
      </td>
      <td>{{ forloop.counter }}</td>
      <td>{{ customer_obj.pk }}</td>
      <td>{{ customer_obj.qq }}</td>
      <td>{{ customer_obj.name }}</td>
      <td>{{ customer_obj.get_sex_display }}</td>
      <td>{{ customer_obj.status_show }}</td>
      <td>{{ customer_obj.introduce_from|default:'无' }}</td>
      <td>{{ customer_obj.consultant|default:'暂无' }}</td>
      <td>
        <a href="{% url 'edit_customer' customer_obj.pk %}"><i class="fa fa-edit"></i></a>
      </td>

    </tr>
  {% endfor %}

  </tbody>
  </table>

{#  {{ page_html|safe }}#}
  {{ page_html }}

{#  <nav aria-label="Page navigation">#}
{#    <ul class="pagination">#}
{#      <li>#}
{#        <a href="#" aria-label="Previous">#}
{#          <span aria-hidden="true">&laquo;</span>#}
{#        </a>#}
{#      </li>#}
{#      {% for i in page_num_range %}#}
{#        <li><a href="/customers/?page={{ i }}">{{ i }}</a></li>#}
{#      {% endfor %}#}
{##}
{#      <li>#}
{#        <a href="#" aria-label="Next">#}
{#          <span aria-hidden="true">&raquo;</span>#}
{#        </a>#}
{#      </li>#}
{#    </ul>#}
{#  </nav>#}

{% endblock %}






